package com.sunsy.authserver.beans.dto;

import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

@Data
public class RegisterDto {


    @NotBlank(message = "手机号不可为空")
    @Pattern(message = "手机号不合法，请检查手机号", regexp = "^[1]\\d{10}$")
    private String mobile;
    @NotBlank(message = "密码不能为空")
//    @Size(message = "密码最少为8个字符，最长为16个字符", min = 8, max = 16)
    @Pattern(regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[\\s\\S]{8,16}$", message = "密码至少8-16个字符，至少1个大写字母，1个小写字母和1个数字")
    private String password;
    private String password2;
    @Size(message = "用户名不可超过20个字符", max = 20)
    @NotBlank
    private String username;
    @Email
    private String email;

}
